<?php

/*
 * This file is part of the symfony package.
 * (c) 2004-2006 Fabien Potencier <fabien.potencier@symfony-project.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

/**
 *
 * @package    symfony
 * @subpackage plugin
 * @author     Fabien Potencier <fabien.potencier@symfony-project.com>
 * @version    SVN: $Id: sfGuardPermissionPeer.php 7634 2008-02-27 18:01:40Z fabien $
 */
class sfGuardPermissionPeer extends PluginsfGuardPermissionPeer
{
    public static function getIdPermisoPorIdPerfilUsuario( $PerfilUsuarioId )
    {
        $c = new Criteria();
        $c->addJoin( $PerfilUsuarioId, sfGuardUserProfilePeer::ID );
        $c->addJoin( sfGuardUserProfilePeer::USER_ID, sfGuardUserPeer::ID );
        $c->addJoin( sfGuardUserPeer::ID, sfGuardUserPermissionPeer::USER_ID );
        $c->addJoin( sfGuardUserPermissionPeer::PERMISSION_ID, self::ID );
        $c->setDistinct();
        $permiso = self::doSelectOne($c); //$self::doSelect($c);
        return $permiso->getId() ;
    }
}
